package cn.lcsjsxy.yxz.day15.abstractclasses.practice;

//

/*
(2)MyDate类包含:private成员变量year,month,day :
toDateString()方法返回日期对应的字符串:xxxx年xx月xx
*/

public class MyDate {

    //年月日
    private int year;       // 年
    private int month;    // 月
    private int day;        // 日

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public MyDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public String toDateString() {
        return year + "年" + month + "月" + day + "日";
    }

}
